//
//  CoreDataManager.h
//  QuickCare
//
//  Created by lidabiao on 16/7/11.
//  Copyright © 2016年 lidabiao. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>

@interface CoreDataManager : NSObject

#define kCoreDataManager [CoreDataManager shareManager]

#define kFileName @"sqlite"

/// 管理对象上下文
@property (nonatomic, strong) NSManagedObjectContext *managedObjectContext;
/// 对象model
@property (nonatomic, strong) NSManagedObjectModel *managedObjectModel;
/// 存储调度器
@property (nonatomic, strong) NSPersistentStoreCoordinator *persistentStoreCoordinator;

+(instancetype)shareManager;

-(void)save;

///  执行检索
///
///  @param entityName 实体类名
///  @param format     谓词语句
///
///  @return 检索结果数组
-(NSArray *)executeFetchWithEntityName:(NSString *)entityName format:(NSString *)format;

@end
